package com.ruoyi.network.handler;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.network.domain.NetworkEdge;
import com.ruoyi.network.service.INetworkEdgeService;
@Component
public class NetworkEventHandler90002 implements NetworkEventHandler{
	@Autowired
	private INetworkEdgeService networkEdgeService;
	@Override
	public void invoke(JSONObject message) throws Exception {
		String terminateId = message.getJSONObject("param").getString("terminateId");
		NetworkEdge bean = networkEdgeService.selectById(terminateId);
		if(bean != null) {
			//change方法对边缘端的在线状态作了判断,必须先更新在线状态
			bean.setOnline(1);
			networkEdgeService.update(bean);
			networkEdgeService.change(bean);
		}
	}
	
}
